//
//  Model_questionDetailNew.m
//  KWNLaywerClient
//
//  Created by 孔六五 on 15/1/16.
//  Copyright (c) 2015年 张明磊. All rights reserved.
//

#import "Model_questionDetailNew.h"

@implementation Model_questionDetailNew

- (void)heightWithData
{
    CGFloat height = 0;
    height = 10 + 20 + 10;    //10时间label与cell上边界距离 20(显示时间高度) 第二个10 时间lebel与之下控件的间隔

    if(self.string_question && self.string_question.length > 0)
    {
        CGSize messageSize = [UIUtils cgrectFor:self.string_question withFont:FontOfQuestionList labWidth:WidthMaxOfMessageImage - 25];       //-25前端气泡间隔15 后端气泡间隔10
        self.qDWidth_label = messageSize.width;
        
        if (messageSize.height + 10*2 > WidthOfHead + 30) {    //30名字label高度  10*2文字label与气泡上下边界10距离
            height = height + messageSize.height + 10*2 + 10;       //10*2label与气泡的间隔 10与之下控件的间隔或者cell的间隔
        }
        else
        {
            height = height + WidthOfHead + 30 + 10;               //10与之下控件的间隔或者cell的间隔
        }
    }
    
    if(self.arr_thumbnail && self.arr_thumbnail.count>0)
    {
        if (50 + 10*2 <= WidthOfHead + 30){                  //30名字label高度
            height = height + WidthOfHead + 30 + 5;
            
        }
        //目前执行不到
        //        else{
        //            height = 5*2 +50 + 10;                         //image高度50 10*2气泡间隔 10cell的间隔
        //        }
    }
    self.qDHeight = height;

}

@end
